package com.linzm.leetcode.mid.tree.迭代遍历;

/**
 * @Author zimingl
 * @Date 2023/2/19 12:43
 * @Description: TODO
 */
public class TreeNode {
    int val;
    TreeNode left;
    TreeNode right;

    TreeNode() {
    }

    TreeNode(int val) {
        this.val = val;
    }

    TreeNode(int val, TreeNode left, TreeNode right) {
        this.val = val;
        this.left = left;
        this.right = right;
    }

    public static TreeNode getTree() {
        // 0-1,2 1-3,4 2-5,6
        TreeNode three = new TreeNode(3);
        TreeNode four = new TreeNode(4);
        TreeNode five = new TreeNode(5);
        TreeNode sex = new TreeNode(6);
        TreeNode one = new TreeNode(1, three, four);
        TreeNode two = new TreeNode(2, five, sex);
        return new TreeNode(0, one, two);
    }
}
